package com.twu.biblioteca.storage;

/**
 * Created by MDH on 20/07/2014.
 */
public class StorageServiceFactory {

    private static StorageServiceFactory instance = null;

    private StorageServiceFactory(){

    }

    public static  StorageServiceFactory getInstance(){
        if(instance == null){
            instance = new StorageServiceFactory();
        }
        return instance;
    }

    public StorageService getStorageService(final int type){
        if(type == StorageService.IN_MEMORY){
            return new StorageServiceInMemoryImpl();
        }

        throw new IllegalArgumentException("Unknown Storage provider");
    }
}
